3.10.5 \(\int (a+i a \tan (e+f x))^4 (c-i c \tan (e+f x))^3 \, dx\) [905]

Optimal. Leaf size=82 \[ \frac {i a^4 c^3 \sec ^6(e+f x)}{6 f}+\frac {a^4 c^3 \tan (e+f x)}{f}+\frac {2 a^4 c^3 \tan ^3(e+f x)}{3 f}+\frac {a^4 c^3 \tan ^5(e+f x)}{5 f} \]

[Out]

1/6*I*a^4*c^3*sec(f*x+e)^6/f+a^4*c^3*tan(f*x+e)/f+2/3*a^4*c^3*tan(f*x+e)^3/f+1/5*a^4*c^3*tan(f*x+e)^5/f

________________________________________________________________________________________

Rubi [A]
time = 0.07, antiderivative size = 82, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.097, Rules used = {3603, 3567, 3852} \begin {gather*} \frac {a^4 c^3 \tan ^5(e+f x)}{5 f}+\frac {2 a^4 c^3 \tan ^3(e+f x)}{3 f}+\frac {a^4 c^3 \tan (e+f x)}{f}+\frac {i a^4 c^3 \sec ^6(e+f x)}{6 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])^4*(c - I*c*Tan[e + f*x])^3,x]

[Out]

((I/6)*a^4*c^3*Sec[e + f*x]^6)/f + (a^4*c^3*Tan[e + f*x])/f + (2*a^4*c^3*Tan[e + f*x]^3)/(3*f) + (a^4*c^3*Tan[
e + f*x]^5)/(5*f)

Rule 3567

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*((d*Sec[
e + f*x])^m/(f*m)), x] + Dist[a, Int[(d*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2
*m] || NeQ[a^2 + b^2, 0])

Rule 3603

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Di
st[a^m*c^m, Int[Sec[e + f*x]^(2*m)*(c + d*Tan[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] &&
EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0] && IntegerQ[m] &&  !(IGtQ[n, 0] && (LtQ[m, 0] || GtQ[m, n]))

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rubi steps

\begin {align*} \int (a+i a \tan (e+f x))^4 (c-i c \tan (e+f x))^3 \, dx &=\left (a^3 c^3\right ) \int \sec ^6(e+f x) (a+i a \tan (e+f x)) \, dx\\ &=\frac {i a^4 c^3 \sec ^6(e+f x)}{6 f}+\left (a^4 c^3\right ) \int \sec ^6(e+f x) \, dx\\ &=\frac {i a^4 c^3 \sec ^6(e+f x)}{6 f}-\frac {\left (a^4 c^3\right ) \text {Subst}\left (\int \left (1+2 x^2+x^4\right ) \, dx,x,-\tan (e+f x)\right )}{f}\\ &=\frac {i a^4 c^3 \sec ^6(e+f x)}{6 f}+\frac {a^4 c^3 \tan (e+f x)}{f}+\frac {2 a^4 c^3 \tan ^3(e+f x)}{3 f}+\frac {a^4 c^3 \tan ^5(e+f x)}{5 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 1.21, size = 63, normalized size = 0.77 \begin {gather*} \frac {a^4 c^3 \sec (e) \sec ^6(e+f x) (10 i \cos (e)-10 \sin (e)+15 \sin (e+2 f x)+6 \sin (3 e+4 f x)+\sin (5 e+6 f x))}{60 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])^4*(c - I*c*Tan[e + f*x])^3,x]

[Out]

(a^4*c^3*Sec[e]*Sec[e + f*x]^6*((10*I)*Cos[e] - 10*Sin[e] + 15*Sin[e + 2*f*x] + 6*Sin[3*e + 4*f*x] + Sin[5*e +
 6*f*x]))/(60*f)

________________________________________________________________________________________

Maple [A]
time = 0.08, size = 75, normalized size = 0.91

method result size
risch \(\frac {16 i a^{4} c^{3} \left (20 \,{\mathrm e}^{6 i \left (f x +e \right )}+15 \,{\mathrm e}^{4 i \left (f x +e \right )}+6 \,{\mathrm e}^{2 i \left (f x +e \right )}+1\right )}{15 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{6}}\) \(61\)
derivativedivides \(-\frac {i a^{4} c^{3} \left (i \tan \left (f x +e \right )-\frac {\left (\tan ^{6}\left (f x +e \right )\right )}{6}+\frac {i \left (\tan ^{5}\left (f x +e \right )\right )}{5}-\frac {\left (\tan ^{4}\left (f x +e \right )\right )}{2}+\frac {2 i \left (\tan ^{3}\left (f x +e \right )\right )}{3}-\frac {\left (\tan ^{2}\left (f x +e \right )\right )}{2}\right )}{f}\) \(75\)
default \(-\frac {i a^{4} c^{3} \left (i \tan \left (f x +e \right )-\frac {\left (\tan ^{6}\left (f x +e \right )\right )}{6}+\frac {i \left (\tan ^{5}\left (f x +e \right )\right )}{5}-\frac {\left (\tan ^{4}\left (f x +e \right )\right )}{2}+\frac {2 i \left (\tan ^{3}\left (f x +e \right )\right )}{3}-\frac {\left (\tan ^{2}\left (f x +e \right )\right )}{2}\right )}{f}\) \(75\)
norman \(\frac {a^{4} c^{3} \tan \left (f x +e \right )}{f}+\frac {2 a^{4} c^{3} \left (\tan ^{3}\left (f x +e \right )\right )}{3 f}+\frac {a^{4} c^{3} \left (\tan ^{5}\left (f x +e \right )\right )}{5 f}+\frac {i a^{4} c^{3} \left (\tan ^{2}\left (f x +e \right )\right )}{2 f}+\frac {i a^{4} c^{3} \left (\tan ^{4}\left (f x +e \right )\right )}{2 f}+\frac {i a^{4} c^{3} \left (\tan ^{6}\left (f x +e \right )\right )}{6 f}\) \(116\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))^4*(c-I*c*tan(f*x+e))^3,x,method=_RETURNVERBOSE)

[Out]

-I/f*a^4*c^3*(I*tan(f*x+e)-1/6*tan(f*x+e)^6+1/5*I*tan(f*x+e)^5-1/2*tan(f*x+e)^4+2/3*I*tan(f*x+e)^3-1/2*tan(f*x
+e)^2)

________________________________________________________________________________________

Maxima [A]
time = 0.52, size = 106, normalized size = 1.29 \begin {gather*} \frac {5 i \, a^{4} c^{3} \tan \left (f x + e\right )^{6} + 6 \, a^{4} c^{3} \tan \left (f x + e\right )^{5} + 15 i \, a^{4} c^{3} \tan \left (f x + e\right )^{4} + 20 \, a^{4} c^{3} \tan \left (f x + e\right )^{3} + 15 i \, a^{4} c^{3} \tan \left (f x + e\right )^{2} + 30 \, a^{4} c^{3} \tan \left (f x + e\right )}{30 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^4*(c-I*c*tan(f*x+e))^3,x, algorithm="maxima")

[Out]

1/30*(5*I*a^4*c^3*tan(f*x + e)^6 + 6*a^4*c^3*tan(f*x + e)^5 + 15*I*a^4*c^3*tan(f*x + e)^4 + 20*a^4*c^3*tan(f*x
 + e)^3 + 15*I*a^4*c^3*tan(f*x + e)^2 + 30*a^4*c^3*tan(f*x + e))/f

________________________________________________________________________________________

Fricas [A]
time = 1.09, size = 146, normalized size = 1.78 \begin {gather*} -\frac {16 \, {\left (-20 i \, a^{4} c^{3} e^{\left (6 i \, f x + 6 i \, e\right )} - 15 i \, a^{4} c^{3} e^{\left (4 i \, f x + 4 i \, e\right )} - 6 i \, a^{4} c^{3} e^{\left (2 i \, f x + 2 i \, e\right )} - i \, a^{4} c^{3}\right )}}{15 \, {\left (f e^{\left (12 i \, f x + 12 i \, e\right )} + 6 \, f e^{\left (10 i \, f x + 10 i \, e\right )} + 15 \, f e^{\left (8 i \, f x + 8 i \, e\right )} + 20 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 15 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 6 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^4*(c-I*c*tan(f*x+e))^3,x, algorithm="fricas")

[Out]

-16/15*(-20*I*a^4*c^3*e^(6*I*f*x + 6*I*e) - 15*I*a^4*c^3*e^(4*I*f*x + 4*I*e) - 6*I*a^4*c^3*e^(2*I*f*x + 2*I*e)
 - I*a^4*c^3)/(f*e^(12*I*f*x + 12*I*e) + 6*f*e^(10*I*f*x + 10*I*e) + 15*f*e^(8*I*f*x + 8*I*e) + 20*f*e^(6*I*f*
x + 6*I*e) + 15*f*e^(4*I*f*x + 4*I*e) + 6*f*e^(2*I*f*x + 2*I*e) + f)

________________________________________________________________________________________

Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 201 vs. \(2 (73) = 146\).
time = 0.43, size = 201, normalized size = 2.45 \begin {gather*} \frac {320 i a^{4} c^{3} e^{6 i e} e^{6 i f x} + 240 i a^{4} c^{3} e^{4 i e} e^{4 i f x} + 96 i a^{4} c^{3} e^{2 i e} e^{2 i f x} + 16 i a^{4} c^{3}}{15 f e^{12 i e} e^{12 i f x} + 90 f e^{10 i e} e^{10 i f x} + 225 f e^{8 i e} e^{8 i f x} + 300 f e^{6 i e} e^{6 i f x} + 225 f e^{4 i e} e^{4 i f x} + 90 f e^{2 i e} e^{2 i f x} + 15 f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))**4*(c-I*c*tan(f*x+e))**3,x)

[Out]

(320*I*a**4*c**3*exp(6*I*e)*exp(6*I*f*x) + 240*I*a**4*c**3*exp(4*I*e)*exp(4*I*f*x) + 96*I*a**4*c**3*exp(2*I*e)
*exp(2*I*f*x) + 16*I*a**4*c**3)/(15*f*exp(12*I*e)*exp(12*I*f*x) + 90*f*exp(10*I*e)*exp(10*I*f*x) + 225*f*exp(8
*I*e)*exp(8*I*f*x) + 300*f*exp(6*I*e)*exp(6*I*f*x) + 225*f*exp(4*I*e)*exp(4*I*f*x) + 90*f*exp(2*I*e)*exp(2*I*f
*x) + 15*f)

________________________________________________________________________________________

Giac [A]
time = 0.78, size = 146, normalized size = 1.78 \begin {gather*} -\frac {16 \, {\left (-20 i \, a^{4} c^{3} e^{\left (6 i \, f x + 6 i \, e\right )} - 15 i \, a^{4} c^{3} e^{\left (4 i \, f x + 4 i \, e\right )} - 6 i \, a^{4} c^{3} e^{\left (2 i \, f x + 2 i \, e\right )} - i \, a^{4} c^{3}\right )}}{15 \, {\left (f e^{\left (12 i \, f x + 12 i \, e\right )} + 6 \, f e^{\left (10 i \, f x + 10 i \, e\right )} + 15 \, f e^{\left (8 i \, f x + 8 i \, e\right )} + 20 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 15 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 6 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^4*(c-I*c*tan(f*x+e))^3,x, algorithm="giac")

[Out]

-16/15*(-20*I*a^4*c^3*e^(6*I*f*x + 6*I*e) - 15*I*a^4*c^3*e^(4*I*f*x + 4*I*e) - 6*I*a^4*c^3*e^(2*I*f*x + 2*I*e)
 - I*a^4*c^3)/(f*e^(12*I*f*x + 12*I*e) + 6*f*e^(10*I*f*x + 10*I*e) + 15*f*e^(8*I*f*x + 8*I*e) + 20*f*e^(6*I*f*
x + 6*I*e) + 15*f*e^(4*I*f*x + 4*I*e) + 6*f*e^(2*I*f*x + 2*I*e) + f)

________________________________________________________________________________________

Mupad [B]
time = 4.71, size = 117, normalized size = 1.43 \begin {gather*} \frac {a^4\,c^3\,\sin \left (e+f\,x\right )\,\left (30\,{\cos \left (e+f\,x\right )}^5+{\cos \left (e+f\,x\right )}^4\,\sin \left (e+f\,x\right )\,15{}\mathrm {i}+20\,{\cos \left (e+f\,x\right )}^3\,{\sin \left (e+f\,x\right )}^2+{\cos \left (e+f\,x\right )}^2\,{\sin \left (e+f\,x\right )}^3\,15{}\mathrm {i}+6\,\cos \left (e+f\,x\right )\,{\sin \left (e+f\,x\right )}^4+{\sin \left (e+f\,x\right )}^5\,5{}\mathrm {i}\right )}{30\,f\,{\cos \left (e+f\,x\right )}^6} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*tan(e + f*x)*1i)^4*(c - c*tan(e + f*x)*1i)^3,x)

[Out]

(a^4*c^3*sin(e + f*x)*(6*cos(e + f*x)*sin(e + f*x)^4 + cos(e + f*x)^4*sin(e + f*x)*15i + 30*cos(e + f*x)^5 + s
in(e + f*x)^5*5i + cos(e + f*x)^2*sin(e + f*x)^3*15i + 20*cos(e + f*x)^3*sin(e + f*x)^2))/(30*f*cos(e + f*x)^6
)

________________________________________________________________________________________